<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Date对象</title>
</head>
<body>
<script>
    var date = new Date();  //以当前时间作为初始参数

    var year = date.getFullYear();
    var month = date.getMonth();    // 一定要注意！！ 月份是以0开始的
    var days = date.getDate();  //获取一个月中的第几天
    var week = date.getDay();   //获取一周中的第几天
    var hours = date.getHours();
    var minutes = date.getMinutes();
    var seconds = date.getSeconds();

    console.log(year);
    console.log(month);
    console.log(days);
    console.log(week);
    console.log(hours);
    console.log(minutes);
    console.log(seconds);

    console.log(date.getTime());
</script>
</body>
</html>